package com.trailer.base.view

import android.os.Bundle
import android.view.View
import androidx.annotation.IdRes
import com.trailer.base.inter.IUser
import kotlinx.coroutines.CoroutineScope

interface BView : BaseView, HelperView, PlaceHolderView, RefreshView {
    fun setStatusBar()
    fun coroutine(): CoroutineScope
    /**
     * @param view 初始化View
     */
    fun initView(view: View?)

    /**
     * 初始化监听器
     */
    fun listeners()

    /**
     * 结束当前的Activity
     */
    fun finishActivity()
    fun finish()

    /**
     * 跳转到登录页面
     */
    fun toLogin()

    fun processCodeOffline()

    /**
     * 此页面是否需要登录
     *
     * @return
     */
    fun needLogin(): Boolean
    fun exitFromTopAnim(): Boolean
    fun user(): IUser?
    fun runOnUi(runnable: Runnable?)

    fun <T> single(clazz: Class<T>?)
    fun <T> bundle(clazz: Class<T>?, bundle: Bundle?)

    @IdRes
    fun provideContainerId(): Int
}
